// <!-- 已登录 -->
// <a href="./member.html">神龙教主假数据</a>
// <a href="./logout.html">退出</a>
// <!-- 已登录 -->

// <!-- 未登录 -->
// <a href="./login.html">你好，请登录</a>
// <a href="./registry.html">免费注册</a>
// <a href="">我的订单</a>
// <!-- 未登录 -->
let unameLocal = (new Date).getTime()>localStorage.getItem('expires') ? null : localStorage.getItem('uname')
let unameSession = sessionStorage.getItem('uname')
let token = localStorage.getItem('token') || sessionStorage.getItem('token')
let uname = unameLocal || unameSession
console.log(uname);
let html = ''
if(uname){
    html=`
    <!-- 已登录 -->
    <a href="./my.html">${uname}</a>
    <a href="./my-order.html">我的订单</a>
    <a href="./logout.html">退出</a>
    <!-- 已登录 -->
    `
}else{
    html=`
    <!-- 未登录 -->
        <a href="./login.html">你好，请登录</a>
        <a href="./registry.html">免费注册</a>
        
    <!-- 未登录 -->
    `
}

document.write(`
<header>
<div class="bar">
  <div class="bar-content">
    <!-- city -->
    <div class="city">
      <i class="iconfont icon-zuobiao"></i>
      <span class="choose-city">南京</span>

      <!-- 请手动选择 -->
      <div class="area">
        <div class="change-city">切换城市<b></b></div>
        <div class="box">
          <ul class="tab">
            <li class="cur">请选择</li>
            <li class="">请选择</li>
            <li class="">请选择</li>
          </ul>
          <div class="tab-content">
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京1</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京2</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京3</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
          </div>
          <div class="tab-content" style="display: none;">
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京4</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京5</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京6</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
          </div>
          <div class="tab-content" style="display: none;">
            <div class="city" area-id="1"><a href="javascript:;">北京7</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京8</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京9</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
            <div class="city" area-id="1"><a href="javascript:;">北京</a><span>-</span></div>
          </div>
        </div>
      </div>
      <!-- 请手动选择 -->
    </div>
    <!-- city -->

    <!-- login -->
    <div class="login">
        ${html}
    </div>
    <!-- login -->
  </div>
</div>
<div class="content">
  <a href="./index.html"><img src="./imgs/logo.png" alt="" class="logo"></a>
  <div class="search">
    <input class="header-search-input" type="text" placeholder="搜索商家或地点">
    <button class="header-search-btn"><span
        class="header-icon icon-search-new iconfont icon-search"></span></button>
  </div>
  <div></div>
</div>
</header>

<script src="./js/jquery-1.8.3.min.js"></script>
<script src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
<script src="./js/chooseLocation.js"></script>
<script src="./js/cate.js"></script>
`)